package soft863.com.demo1007;

import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class Flow implements Writable {
    long upflow;
    long downflow;
    long sumflow;

    public Flow() {
    }

    public Flow(long upflow, long downflow, long sumflow) {
        this.upflow = upflow;
        this.downflow = downflow;
        this.sumflow = sumflow;
    }

    public long getUpflow() {
        return upflow;
    }

    public void setUpflow(long upflow) {
        this.upflow = upflow;
    }

    public long getDownflow() {
        return downflow;
    }

    public void setDownflow(long downflow) {
        this.downflow = downflow;
    }

    public long getSumflow() {
        return sumflow;
    }

    public void setSumflow(long sumflow) {
        this.sumflow = sumflow;
    }


    @Override
    public String toString() {
        return ":" +
                "upflow=" + upflow +
                ", downflow=" + downflow +
                ", sumflow=" + sumflow;
    }

    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeLong(upflow);
        dataOutput.writeLong(downflow);
        dataOutput.writeLong(sumflow);

    }

    public void readFields(DataInput dataInput) throws IOException {
        upflow = dataInput.readLong();
        downflow = dataInput.readLong();
        sumflow = dataInput.readLong();

    }
}

